<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="css/font-awesome.min.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/templatemo-style.css" rel="stylesheet">
    <script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="js/teacher.js"></script>
    <title>个人信息</title>
</head>

<body>
    <?php 
    require_once("./system/loginCheck.php");
    require_once("../congfig/config.php");
     ?>
    <div class="templatemo-flex-row">
        <div class="templatemo-sidebar">
            <header class="templatemo-site-header">
                <div class="square"></div>
                <h1>教师管理系统</h1>
            </header>
            <div class="profile-photo-container">
                <img src="images/profile-photo.jpg" alt="Profile Photo" class="img-responsive">
            </div>
            <!-- Search box -->

            <div class="mobile-menu-icon">
                <i class="fa fa-bars"></i>
            </div>
            <nav class="templatemo-left-nav">
                <ul>
                    <li><a href="../index.php"><i class="fa fa-map-marker fa-fw"></i>首页</a></li>
                    <li id="xmgl"><a href="project-list.php"><i class="fa fa-bars fa-fw"></i>我的项目</a> </li>
                    <li id="yhgl"><a href="addProject.php"><i class="fa fa-fire fa-fw"></i>发布项目</a></li>
                    <li id="grxx"><a href="#" class="active"><i class="fa fa-user fa-fw"></i>个人信息</a></li>
                    <li><a href="pad-check.php"><i class="fa fa-cog fa-fw"></i>修改密码</a></li>
                    <li><a href="../loginout.php"><i class="fa fa-map-marker fa-fw"></i>注销</a></li>
                </ul>
            </nav>
        </div>
        <?php 
        $teacher=$_SESSION['username'];
        $sql="select uid from users where username='$teacher'";
        $result=$conn->query($sql);
        $row=$result->fetch_array();
        $uid=$row["uid"];
        $sql1="select * from userinfor where uid=$uid";
        $result1=$conn->query($sql1);
        $row1=$result1->fetch_array();
        if($row1!=false){
            $realname=$row1["realname"];
            $age=$row1["age"];
            $tel=$row1["phone"];
            $alter="readonly";
        } 
        if($row1==false){
            $realname="";
            $age="";
            $tel="";
            $alter="";}
         ?> 
        
        <div class="templatemo-content col-1 light-gray-bg" style="height:1000px;">
            <div class="container" style="margin-top:100px;">
                <div style="padding: 50px 0;margin-top: 50px;text-align: right;width: 420px;margin: 50px auto;">
                    <form action="dotOwner.php" method="post" class="form-horizontal" id="owner">
                        <input type="hidden" name="uid" value="<?php echo $uid; ?>">
                        <div class="form-group">
                            <label for="sKnot" class="col-xs-4 control-label">真实姓名：</label>
                            <div class="col-xs-8">
                                <input type="text" value="<?php echo $realname?>" <?php echo $alter; ?> placeholder="您只有一次填写机会" class="form-control input-sm duiqi" id="tName" name="tName" style="margin-top: 7px;">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="sKnot" class="col-xs-4 control-label">年龄：</label>
                            <div class="col-xs-8">
                                <input type="text" value="<?php echo $age?>" class="form-control input-sm duiqi" id="tTel" name="tAge"
                                    style="margin-top: 7px;">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="sKnot" class="col-xs-4 control-label">电话：</label>
                            <div class="col-xs-8">
                                <input type="tel" value="<?php echo $tel?>" class="form-control input-sm duiqi" id="tBirthday" name="tPhone"
                                    style="margin-top: 7px;">
                            </div>
                        </div>
                        <div class="form-group text-right">
                            <div class="col-xs-offset-4 col-xs-5" style="margin-left: 140px;margin-top: 20px;">
                                <input type="submit" class="btn btn-xs btn-success" id="owner-bc" value="保存">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div><?php 
               if (isset($_GET["text"])) {
                  $text=$_GET["text"];
                  echo "<script>alert('$text')</script>";
               } ?>
</body>

</html>
